package mp1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import mp1.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    @Select("SELECT * FROM product WHERE id IN(SELECT id  FROM product_supplier WHERE supplier_id IN(SELECT id FROM supplier WHERE name=#{supplierName}))")
    List<Product> findProBySupplier(String supplierName);

}
